<include file="public@header"/>
<style>
    th,td{
        text-align: center;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Wuye/reservation')}">预约业务列表</a></li>
        <li><a href="{:url('Wuye/reservationadd')}">添加预约业务</a></li>
    </ul>
    <form id="submitForm" class="well form-inline margin-top-20" method="post" action="{:url('Wuye/reservation')}">&nbsp;
        关键字:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入关键字...">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger"  href="{:url('Wuye/reservation')}" >清空</a>
    </form>
    <form class="js-ajax-form" action="" method="post">
        <button style="margin: 5px;" class="btn btn-danger btn-sm js-ajax-submit" type="submit"
                data-action="{:url('wuye/dels')}" data-subcheck="true" data-msg="您确定删除吗？">
            {:lang('DELETE')}
        </button>
        <input type="hidden" name="table" value="wy_reservation">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="15">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th >业务简介</th>
                <th width="200">业务图片</th>
                <th style="text-align: left;"width="200">联系电话</th>
                <th style="text-align: left;"width="200">发布时间</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <notempty name="express">
                <foreach name="express" item="vo">
                    <tr>
                        <td>
                            <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                                   value="{$vo.id| default=''}" title="ID:{$vo.id| default=''}">
                        </td>
                        <td>{$vo.desc|default=''}</td>
                        <td>
                            <div id="layer-photos-demo{$vo.id}" class="layer-photos-demo">
                                <img src="<?php echo DS . 'upload' . DS?>{$vo.imgsrc | default=''}" width="50">
                            </div>
                        </td>
                        <td>{$vo.phone|default=''}</td>
                        <td><?php echo date('Y-m-d H:i',$vo['time']);?></td>
                        <td>
                            <a href="javascript:;" onclick="del({$vo.id|default=''},'wy_baoxiu');">删除</a>
                        </td>
                    </tr>
                    <script>
                        layer.photos({
                            photos: '#layer-photos-demo{$vo.id|default=""}'
                            ,anim: <?php echo rand(1,6)?>
                        });
                    </script>
                </foreach>
            </notempty>
            <tfoot>
            <tr>
                <th width="15">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th>业务简介</th>
                <th width="200">业务图片</th>
                <th style="text-align: left;"width="200">联系电话</th>
                <th style="text-align: left;"width="200">发布时间</th>
                <th width="100">操作</th>
            </tr>
            </tfoot>
        </table>
        <div class="pagination">{$page|default=''}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/jquery-1.10.2.min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<script>
    function del(id,table) {
        layer.confirm('是否删除？删除之后无法恢复', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url:"{:url('Wuye/del')}",
                data:{'id':id,'table':table},
                type:"Post",
                dataType:"json",
                success:function(data){
                    layer.msg(data.msg,{icon: 6,time: 1000},function () {
                        location.reload();
                    });
                }
            });
        }, function(){

        });
    }


</script>
</body>
</html>